<template>
  <div>
      <!-- <div class="unit-form-view" v-for="(item,key) in form" :key="key">
          1
      </div> -->
      <el-form size="mini" label-position="right" label-width="100px">
          <el-form-item  v-for="(item,key) in form" :key="key" :label="item.name">
              <el-input type="text" :placeholder="'请输入'+item.name" v-if="item.type == 'text'" v-model="item.value"></el-input>
              <el-input type="number" :placeholder="'请输入'+item.name" v-if="item.type == 'number'" v-model="item.value"></el-input>
              <el-input type="textarea" :placeholder="'请输入'+item.name" v-if="item.type == 'textarea'" v-model="item.value"></el-input>
              <el-select  v-if="item.type == 'select'" v-model="item.value" class="unit-form-view-select">
                  <el-option v-for="(items,keys) in item.data" :key="keys" :label="items.label" :value="items.value"></el-option>
              </el-select>
              <el-date-picker v-if="item.type == 'date'"  class="unit-form-view-select" type="datetime" placeholder="选择日期时间" v-model="item.value" value-format="timestamp"></el-date-picker>
              <el-radio-group v-model="item.value" v-if="item.type == 'radio' && item.name != '性别'">
                    <el-radio v-for="(items,keys) in item.data" :key="keys" :label="items.value">{{items.label}}</el-radio>
              </el-radio-group>
              <el-radio-group v-model="item.value" v-if="item.type == 'radio' && item.name == '性别' ">
                    <el-radio :label="1" :disabled="item.limit == 2 ? true : false">男</el-radio>
                    <el-radio :label="2" :disabled="item.limit == 1 ? true : false">女</el-radio>
              </el-radio-group>
              <div class="unit-form-view-image" v-if="item.type == 'image' ">
                  <i class="el-icon-picture-outline"></i>
              </div>
          </el-form-item>
      </el-form>
  </div>
</template>

<script>
export default {
    props : {form : {}},
    mounted(){
    },
}
</script>

<style>
.unit-form-view-select{width: 100% !important;}
.unit-form-view-image{width: 60px;
    height: 60px;
    background: #f8f8f8;
    border-radius: 3px;
    text-align: center;
    line-height: 60px;
    cursor: pointer;}
.unit-form-view-image i {
    font-size: 24px;
    line-height: 60px;
    color: #aaa;
}
</style>